package com.example.mylearn.designPattern.strategy;

import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Dreamer
 */

@Component
public class StrategyFactory {


    @Autowired
    private Map<String, AuthStrategy> authStrategyMap = new HashMap<>();

    public AuthStrategy getStrategy(String strategy) {
        return authStrategyMap.get(strategy + "Strategy");
    }
}
